﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x02000373 RID: 883
	public class TWhenClauseItem : TParseTreeNode
	{
		// Token: 0x170007F4 RID: 2036
		// (get) Token: 0x060024E2 RID: 9442 RVA: 0x00339336 File Offset: 0x00337536
		// (set) Token: 0x060024E3 RID: 9443 RVA: 0x0033933E File Offset: 0x0033753E
		public virtual TExpressionList ConditionList
		{
			get
			{
				return this.conditionList;
			}
			set
			{
				this.conditionList = value;
			}
		}

		// Token: 0x170007F5 RID: 2037
		// (get) Token: 0x060024E4 RID: 9444 RVA: 0x00339347 File Offset: 0x00337547
		// (set) Token: 0x060024E5 RID: 9445 RVA: 0x0033934F File Offset: 0x0033754F
		public virtual TConstantList Count_fraction_description_list
		{
			get
			{
				return this.count_fraction_description_list;
			}
			set
			{
				this.count_fraction_description_list = value;
			}
		}

		// Token: 0x170007F6 RID: 2038
		// (get) Token: 0x060024E6 RID: 9446 RVA: 0x00339358 File Offset: 0x00337558
		// (set) Token: 0x060024E7 RID: 9447 RVA: 0x00339360 File Offset: 0x00337560
		public virtual TExpression Comparison_expr
		{
			get
			{
				return this.comparison_expr;
			}
			set
			{
				this.comparison_expr = value;
			}
		}

		// Token: 0x170007F7 RID: 2039
		// (get) Token: 0x060024E8 RID: 9448 RVA: 0x00339369 File Offset: 0x00337569
		// (set) Token: 0x060024E9 RID: 9449 RVA: 0x00339371 File Offset: 0x00337571
		public virtual TExpression Return_expr
		{
			get
			{
				return this.return_expr;
			}
			set
			{
				this.return_expr = value;
			}
		}

		// Token: 0x170007F8 RID: 2040
		// (get) Token: 0x060024EA RID: 9450 RVA: 0x0033937A File Offset: 0x0033757A
		// (set) Token: 0x060024EB RID: 9451 RVA: 0x00339395 File Offset: 0x00337595
		public virtual TStatementList Statement_list
		{
			get
			{
				if (this.statement_list == null)
				{
					this.statement_list = new TStatementList();
				}
				return this.statement_list;
			}
			set
			{
				this.statement_list = value;
			}
		}

		// Token: 0x060024EC RID: 9452 RVA: 0x003393A0 File Offset: 0x003375A0
		public override void init(object arg1, object arg2)
		{
			if (arg1 is TExpression)
			{
				this.comparison_expr = (TExpression)arg1;
				if (this.comparison_expr.ExpressionType == EExpressionType.assignment_t)
				{
					this.comparison_expr.ExpressionType = EExpressionType.simple_comparison_t;
				}
			}
			else if (arg1 is TExpressionList)
			{
				this.conditionList = (TExpressionList)arg1;
			}
			if (arg2 is TExpression)
			{
				this.return_expr = (TExpression)arg2;
				return;
			}
			if (arg2 is TConstantList)
			{
				this.count_fraction_description_list = (TConstantList)arg2;
				return;
			}
			this.stmts = (TStatementListSqlNode)arg2;
		}

		// Token: 0x060024ED RID: 9453 RVA: 0x0033942C File Offset: 0x0033762C
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			if (this.comparison_expr != null)
			{
				this.comparison_expr.doParse(psql, plocation);
			}
			else if (this.conditionList != null)
			{
				this.conditionList.doParse(psql, plocation);
			}
			if (this.return_expr != null)
			{
				this.return_expr.doParse(psql, plocation);
				return;
			}
			if (this.stmts != null)
			{
				this.stmts.doParse(psql, plocation);
				for (int i = 0; i < this.stmts.size(); i++)
				{
					this.Statement_list.add(this.stmts.getStatementSqlNode(i).Stmt);
				}
			}
		}

		// Token: 0x060024EE RID: 9454 RVA: 0x003394C2 File Offset: 0x003376C2
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060024EF RID: 9455 RVA: 0x003394D4 File Offset: 0x003376D4
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.comparison_expr != null)
			{
				this.comparison_expr.acceptChildren(v);
			}
			else if (this.conditionList != null)
			{
				this.conditionList.acceptChildren(v);
			}
			if (this.return_expr != null)
			{
				this.return_expr.acceptChildren(v);
			}
			else if (this.stmts != null)
			{
				this.Statement_list.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001C9F RID: 7327
		private TExpression comparison_expr;

		// Token: 0x04001CA0 RID: 7328
		private TExpression return_expr;

		// Token: 0x04001CA1 RID: 7329
		private TStatementListSqlNode stmts;

		// Token: 0x04001CA2 RID: 7330
		private TExpressionList conditionList;

		// Token: 0x04001CA3 RID: 7331
		private TConstantList count_fraction_description_list;

		// Token: 0x04001CA4 RID: 7332
		private TStatementList statement_list;
	}
}
